# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgname=jsonrpc-glib
pkgver=3.26.1
pkgrel=2
pkgdesc="A JSON-RPC library for GLib"
url="https://git.gnome.org/browse/jsonrpc-glib"
arch=(i686 x86_64)
license=(LGPL)
depends=(json-glib)
makedepends=(git meson vala gobject-introspection gtk-doc)
_commit=3cac93a18dd95572027d9817c0ea046838f8bcb9  # tags/3.26.1^0
source=("git+https://git.gnome.org/browse/jsonrpc-glib#commit=$_commit"
        libdir.diff)
sha256sums=('SKIP'
            'c2ce8d5bf186da1acf95cd75fdb596e95bc6054202a7a9bd5c19e923f0ad012a')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  mkdir build
  cd $pkgname
  patch -Np1 -i ../libdir.diff
}

build() {
  cd build
  arch-meson ../$pkgname -Denable_gtk_doc=true
  ninja
}

check() {
  cd build
  meson test
}

package() {
  cd build
  DESTDIR="$pkgdir" ninja install
}
